package com.zhuoxin.dao.admin;

import org.apache.commons.lang.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.Query;

import com.zhuoxin.bean.system.About;
import com.zhuoxin.bean.system.AboutSO;
import com.zhuoxin.dao.BaseDAOImpl;

public class AboutDAOImpl extends BaseDAOImpl<About, AboutSO> implements AboutDAO {

	@Override
	public String getHqlWhere(AboutSO so) {
		return null;
	}

	@Override
	public void setCriteriaParams(Criteria criteria, AboutSO so) {

	}

	@Override
	public void setQueryParams(Query query, AboutSO so) {

	}

	@Override
	public void switchVO2PO(About po, AboutSO so) {
		if (StringUtils.isNotEmpty(so.getName())) {
			po.setName(StringUtils.trim(so.getName()));
		}

		if (StringUtils.isNotEmpty(so.getNetwork())) {
			po.setNetwork(StringUtils.trim(so.getNetwork()));
		}

		if (StringUtils.isNotEmpty(so.getPhone())) {
			po.setPhone(StringUtils.trim(so.getPhone()));
		}

		if (StringUtils.isNotEmpty(so.getFax())) {
			po.setFax(StringUtils.trim(so.getFax()));
		}

		if (StringUtils.isNotEmpty(so.getMobile())) {
			po.setMobile(StringUtils.trim(so.getMobile()));
		}

		if (StringUtils.isNotEmpty(so.getAddress())) {
			po.setAddress(StringUtils.trim(so.getAddress()));
		}

		if (StringUtils.isNotEmpty(so.getQq())) {
			po.setQq(StringUtils.trim(so.getQq()));
		}

		if (StringUtils.isNotEmpty(so.getEmail())) {
			po.setEmail(StringUtils.trim(so.getEmail()));
		}

		if (StringUtils.isNotEmpty(so.getIcp())) {
			po.setIcp(StringUtils.trim(so.getIcp()));
		}
		
		if (StringUtils.isNotEmpty(so.getPostcode())) {
			po.setPostcode(StringUtils.trim(so.getPostcode()));
		}
		
	}
}
